package com.iwayin.web.action.fans;

import java.util.List;

import com.iwayin.core.bo.fans.FansBO;
import com.iwayin.core.dataobject.FansDO;
import com.iwayin.core.dataobject.UserDO;
import com.iwayin.web.action.BaseAction;
import com.iwayin.web.common.AjaxResult;

public class FansAction extends BaseAction {

	private static final long serialVersionUID = -4105465558513081948L;

	private FansDO query;
	private List<UserDO> userList;
	private AjaxResult ajaxResult;
	private FansBO fansBO;
	private UserDO user;

	/**
	 * @descriptions 查询fans列表
	 * @return
	 */
	public String findFansList() {
		if (query == null) {
			query = new FansDO();
		}
		Long userId = null;
		if (this.getLoginUser() != null) {
			userId = this.getLoginUser().getId();
			user = this.getLoginUser();
		}
		userList = this.fansBO.findFansList(userId, query);
		return SUCCESS;
	}
	/**
	 * 未登录粉丝查询
	 * @return
	 */
	public String findNoLoginFansList(){
		userList = this.fansBO.findFansList(null, query);
		return SUCCESS;
	}
	public FansDO getQuery() {
		return query;
	}

	public void setQuery(FansDO query) {
		this.query = query;
	}

	public List<UserDO> getUserList() {
		return userList;
	}

	public AjaxResult getAjaxResult() {
		return ajaxResult;
	}

	public void setFansBO(FansBO fansBO) {
		this.fansBO = fansBO;
	}

	public UserDO getUser() {
		return user;
	}

	public void setUser(UserDO user) {
		this.user = user;
	}
}
